package com.dunshan.hprose.servlet;

import com.dunshan.hprose.service.DunshanHpService;
import hprose.common.HproseMethods;
import hprose.server.HproseServlet;
import org.springframework.beans.factory.annotation.Autowired;

import javax.servlet.annotation.WebServlet;

/**
 * @author LiWen
 * @version 1.0
 * @Date: 2021-05-04 15:24
 * @Description: hprose 服务注册接口
 */
@WebServlet(urlPatterns = {"/api/sayHello", "/api/sayBye", "/api/getUser"})
public class DunshanHpServlet extends HproseServlet {

    @Autowired
    DunshanHpService dunshanHpService;

    @Override
    public void setGlobalMethods(HproseMethods methods) {
        super.setGlobalMethods(methods);
//        methods.addMethod("sayHello",helloService); 注册sayHello单个方法
        //注册HelloService下所有的publice方法
        methods.addInstanceMethods(dunshanHpService);
    }
}
